Skip to content

Update useReducer hook reference example #1895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update useReducer hook reference example #1895

wants to merge 1 commit into from

Conversation

henrikgs
Copy link

@henrikgs henrikgs commented Apr 3, 2019

The initialState prop that may be passed to the Counter component shadows the initialState constant declared at the top of the example. If the example code is run without passing initialState the code will fail with the error Uncaught TypeError: Cannot read property 'count' of undefined.

Before: https://codesandbox.io/s/jzm0k3o4y9
After: https://codesandbox.io/s/506v6j107k

The `initialState` prop that may be passed to the `Counter` component shadows the `initialState` constant declared at the top of the example. If the example code is run without passing `initialState` the code will fail with the error `Uncaught TypeError: Cannot read property 'count' of undefined`.

Before: https://codesandbox.io/s/jzm0k3o4y9
After: https://codesandbox.io/s/506v6j107k
@reactjs-bot
Copy link

Deploy preview for reactjs ready!

Built with commit 736bd9f

https://deploy-preview-1895--reactjs.netlify.com

@henrikgs
Copy link
Author

@lex111 #1992 fixed this (even though my PR was more than a month earlier 😞). Can be closed.

@lex111
Copy link
Member

lex111 commented Jun 13, 2019

@henrikgs sorry man :(

@lex111 lex111 closed this Jun 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants